package com.thon.entity.user;


import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.thon.entity.util.IdEntity;

/**
 * address
 */

@Entity
@Table(name = "send_to")
@JsonIgnoreProperties(ignoreUnknown = true)
public class SendTo extends IdEntity {
	
	/**
	 * 发货地址
	 */
	private static final long serialVersionUID = -7549842588315162374L;
	
	private String name;
	private Integer cityId;
	private Integer provinceId;
	private Integer districtId;
	private String endRegion;
	private String phone;//收货人电话
	private User user;
	private Integer isDefault;//是否为默认地址标志（0：不是默认地址，1：默认收货地址）
//	private String address;
	
	public SendTo() {
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getEndRegion() {
		return endRegion;
	}
	
	public void setEndRegion(String endRegion) {
		this.endRegion = endRegion;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Integer getCityId() {
		return cityId;
	}

	public void setCityId(Integer cityId) {
		this.cityId = cityId;
	}

	public Integer getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(Integer provinceId) {
		this.provinceId = provinceId;
	}

	public Integer getDistrictId() {
		return districtId;
	}

	public void setDistrictId(Integer districtId) {
		this.districtId = districtId;
	}

	public Integer getIsDefault() {
		return isDefault;
	}

	public void setIsDefault(Integer isDefault) {
		this.isDefault = isDefault;
	}
	
//	public String getAddress() {
//		return name+","+phone+","+endRegion+","+districtId+","+cityId +","+provinceId;
//	}
}
